package com.e3.web.index.client;


import com.e3.web.index.model.NavigatorModel;
import com.extjs.gxt.ui.client.event.MenuEvent;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.widget.menu.MenuItem;

public class MainMenuItem extends MenuItem implements MainNavigatorListener{
		
	private NavigatorModel module;

	public MainMenuItem(NavigatorModel module,SelectionListener<MenuEvent> listener) {
		super(module.getName());
		addSelectionListener(listener);
		setModule(module);
	}

	public NavigatorModel getModule() {
		return module;
	}

	public void setModule(NavigatorModel module) {
		this.module = module;
	}

	public void onElementSelected(MainFrameUI mainFrame) {
		NavigatorHelper.onElementSelected(mainFrame, module, this.getText());
	}
	
}
